package com.core.reach.cloudhub.service;

import com.core.reach.cloudhub.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/4/1 9:54
 **/
@FeignClient(value = "seata-account-service")
public interface AccountService {

    /**
     * 扣减余额
     * @param userId 用户编号
     * @param money 金额
     * @return CommonResult
     */
    @PostMapping("/account/decrease")
    CommonResult decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money);

}